
package gov.chinatax.ctcps.generator.form;

import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for xtglJedwpz.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="xtglJedwpzForm"
 */
public class XtglJedwpzForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _pzbh = null;
   private java.lang.String _nd = null;
   private java.lang.String _mkbs = null;
   private java.lang.String _jedwbs = null;
   private java.lang.String _xswcd = null;
   private java.lang.String _zt1 = null;
   private java.lang.String _zt2 = null;

   /**
    * Standard constructor.
    */
   public XtglJedwpzForm() {
   }

   /**
    * Returns the pzbh
    *
    * @return the pzbh
    */
   public java.lang.String getPzbh() {
      return _pzbh;
   }

   /**
    * Sets the pzbh
    *
    * @param pzbh the new pzbh value
    */
   public void setPzbh(java.lang.String pzbh) {
      _pzbh = pzbh;
   }
   /**
    * Returns the nd
    *
    * @return the nd
    */
   public java.lang.String getNd() {
      return _nd;
   }

   /**
    * Sets the nd
    *
    * @param nd the new nd value
    */
   public void setNd(java.lang.String nd) {
      _nd = nd;
   }
   /**
    * Returns the mkbs
    *
    * @return the mkbs
    */
   public java.lang.String getMkbs() {
      return _mkbs;
   }

   /**
    * Sets the mkbs
    *
    * @param mkbs the new mkbs value
    */
   public void setMkbs(java.lang.String mkbs) {
      _mkbs = mkbs;
   }
   /**
    * Returns the jedwbs
    *
    * @return the jedwbs
    */
   public java.lang.String getJedwbs() {
      return _jedwbs;
   }

   /**
    * Sets the jedwbs
    *
    * @param jedwbs the new jedwbs value
    */
   public void setJedwbs(java.lang.String jedwbs) {
      _jedwbs = jedwbs;
   }
   /**
    * Returns the xswcd
    *
    * @return the xswcd
    */
   public java.lang.String getXswcd() {
      return _xswcd;
   }

   /**
    * Sets the xswcd
    *
    * @param xswcd the new xswcd value
    */
   public void setXswcd(java.lang.String xswcd) {
      _xswcd = xswcd;
   }
   /**
    * Returns the zt1
    *
    * @return the zt1
    */
   public java.lang.String getZt1() {
      return _zt1;
   }

   /**
    * Sets the zt1
    *
    * @param zt1 the new zt1 value
    */
   public void setZt1(java.lang.String zt1) {
      _zt1 = zt1;
   }
   /**
    * Returns the zt2
    *
    * @return the zt2
    */
   public java.lang.String getZt2() {
      return _zt2;
   }

   /**
    * Sets the zt2
    *
    * @param zt2 the new zt2 value
    */
   public void setZt2(java.lang.String zt2) {
      _zt2 = zt2;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getPzbh() == null) {
         errors.add("pzbh", new ActionError("error.pzbh.required"));
      }
      if(getNd() == null) {
         errors.add("nd", new ActionError("error.nd.required"));
      }
      if(getMkbs() == null) {
         errors.add("mkbs", new ActionError("error.mkbs.required"));
      }
      if(getJedwbs() == null) {
         errors.add("jedwbs", new ActionError("error.jedwbs.required"));
      }
      if(getXswcd() == null) {
         errors.add("xswcd", new ActionError("error.xswcd.required"));
      }
      if(getZt1() == null) {
         errors.add("zt1", new ActionError("error.zt1.required"));
      }
      if(getZt2() == null) {
         errors.add("zt2", new ActionError("error.zt2.required"));
      }
      // TODO test format/data
      return errors;
   }
}
